/*
 * Filename:	dht11.h
 * 
 *
 *
 *	Date				Author				Change
 *	2018.0416		GuanJingxin		First set up
 */
#ifndef _DHT11_H
#define _DHT11_H

#include "includes.h"
#include "stm32f10x.h"

#define 	SET_DHT11_IO_IN()  {GPIOB->CRH&=0XFFFF0FFF;GPIOB->CRH|=8<<12;}
#define 	SET_DHT11_IO_OUT() {GPIOB->CRH&=0XFFFF0FFF;GPIOB->CRH|=3<<12;}

#define 	DHT11_IO	 			GPIO_Pin_11
#define 	DHT11_IO_L()		GPIOB->BRR = DHT11_IO;
#define 	DHT11_IO_H()		GPIOB->BSRR = DHT11_IO;
#define 	DHT11_IN()			GPIO_ReadInputDataBit(GPIOB,DHT11_IO)

uint8_t DHT11_Init(void);
uint8_t DHT11_Read_Data(uint8_t *temp,uint8_t *humi);

#endif